RAD Studio VCL Reference
ContentsIndex
PreviousUpNext
AnsiString::[] Operator (int)

Returns the character at a specified index in the string.

Pascal
operator [](const idx: Integer);
operator [](const idx: Integer);
C++
__fastcall char operator [](const int idx) const;
__fastcall char& operator [](const int idx);

This System::AnsiString::[] returns the byte in the string at index value idx. The System::AnsiString::[] assumes a base index of 1.

Note: If the string contains multi-byte characters, the System::AnsiString::[] may return a byte value that represents the wrong character and/or a partial character. For character-level access, use the SubString method.
 

System::AnsiString::substring

Copyright(C) 2008 CodeGear(TM). All Rights Reserved.
What do you think about this topic? Send feedback!